<template>
  <div>
    <a-tag :color="formatter(colorList)" v-for="(item,index) in list" :key="index">{{item.title}}</a-tag>
  </div>
</template>

<script lang="ts">
import { Component, Vue, Prop, Emit } from "vue-property-decorator";

@Component({
  name: "sys-authority-personnel",

  layout: "menu"
})
export default class SysAuthorityPersonnel extends Vue {
  list: any[] = [
    {
      title: "测试"
    },
    {
      title: "周凯"
    }
  ];
  colorList: string[] = [
    "pink",
    "red",
    "orange",
    "green",
    "cyan",
    "blue",
    "purple"
  ];
  formatter(val: string[]) {
    let result = Math.round(Math.random() * 10);
    console.log(result);
    if (result > val.length) {
      result = 0;
    }
    return val[result];
  }
}
</script>

<style lang='less' scoped>
</style>